<?php

namespace App\Http\ViewComposers;

use Illuminate\View\View;
use App\Http\Controllers\Api\UserApi;

class ProfileComposer
{


    /**
     * 绑定数据到视图.
     *
     * @param View $view
     * @return void
     */
    public function compose(View $view)
    {

        $userApi = new UserApi;
        
        //在视图中使用{{$count}}拿到aa
        $view->with('count', 'aa');
        // $view->with('userdata', UserApi::getUserData() );
        $view->with('data',  $userApi->getData() );

    }
}
